class Solution {
public:
    vector<int> successfulPairs(vector<int>& a, vector<int>& b, long long k) {
        int n = a.size();
        int m = b.size();
        sort(b.begin(), b.end());
        vector<int>ans;
        for (int i = 0; i < n; i++) {
            long long x = (k + a[i] - 1) / a[i];
            //cout<<"x=="<<x<<endl;
            int l = -1, r = m;
            while (l + 1 < r) {
                int mid = (l + r) >> 1;
                if (b[mid] >= x)r = mid;
                else l = mid;
            }
            cout << "r==" << r << endl;
            ans.push_back(m - r);
        }
        return ans;
    }
};